<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var countSeniors = function (details) {
      let num = 0;
      for (let item of details) {
        if (Number(item.substring(11, 13)) > 60) num++
      }
      return num;
    };
    console.log(countSeniors(details = ["7868190130M7522", "5303914400F9211", "9273338290F4010"]))
  </script>
</body>

</html>